package cn.gzjp.modules.woms.service;

import java.util.List;

import cn.gzjp.modules.woms.entity.EventPic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.gzjp.common.persistence.Page;
import cn.gzjp.common.service.CrudService;
import cn.gzjp.modules.woms.entity.EventProcess;
import cn.gzjp.modules.woms.dao.EventProcessDao;

/**
 * 工单处理过程Service
 * @author liyp
 * @version 2018-07-15
 */
@Service
@Transactional(readOnly = true)
public class EventProcessService extends CrudService<EventProcessDao, EventProcess> {

	@Autowired
	private EventPicService eventPicService;

	public EventProcess get(String id) {
		EventProcess process =  super.get(id);
		if(process!=null) {
			EventPic search = new EventPic();
			search.setProcessId(id);
			process.setEventPicList(eventPicService.findList(search));
		}
		return process;
	}
	
	public List<EventProcess> findList(EventProcess eventProcess) {
		return super.findList(eventProcess);
	}
	
	public Page<EventProcess> findPage(Page<EventProcess> page, EventProcess eventProcess) {
		return super.findPage(page, eventProcess);
	}
	
	@Transactional(readOnly = false)
	public void save(EventProcess eventProcess) {
		super.save(eventProcess);
	}
	
	@Transactional(readOnly = false)
	public void delete(EventProcess eventProcess) {
		super.deleteByLogic(eventProcess);
	}
	
}